package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 库位和存储箱关系表
 * </p>
 *
 * @author mt
 * @since 2021-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_location_storage_box_rel")
public class LocationStorageBoxRel extends Model<LocationStorageBoxRel> {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 删除标志，是否有效:1 可用 0不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 添加时间，每次修改记录要更新记录新增时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @TableField("creator_id")
    private Long creatorId;

    /**
     * 更新人id
     */
    @TableField("updater_id")
    private Long updaterId;

    /**
     * 修改时间，更具修改时间来判断下次执行顺序，第一次修改时间和新增时间相同
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号 默认为 1
     */
    @TableField("version")
    @Version
    private String version;

    /**
     * 状态	0初始化，1损坏
     */
    @TableField("status")
    private Integer status;

    /**
     * 内部编码，系统自动生成
     */
    @TableField("inter_code")
    private String interCode;

    /**
     * 编码
     */
    @TableField("code")
    private String code;

    /**
     * 绑定存储箱id，关联存储箱表：t_storage_box
     */
    @TableField("storage_box_id")
    private Long storageBoxId;

    /**
     * 是否为空	0空箱，1有货
     */
    @TableField("is_empty")
    private Integer isEmpty;

    /**
     * 库位id，关联库位表：t_location
     */
    @TableField("location_id")
    private Long locationId;

    /**
     * 工单号，设备to设备获取，每个基板都带有工单编码，第一片基板放入存储箱时插入标记了
     */
    @TableField("work_order_no")
    private String workOrderNo;

    /**
     * 工序
     */
    @TableField("process_code")
    private String processCode;

    /**
     * 下一个工序，如果是货物有货存在下一个工序信息，如果空箱没有下一个工序
     */
    @TableField("next_process_code")
    private String nextProcessCode;


    public static final String ID = "id";

    public static final String VALID = "valid";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATOR_ID = "creator_id";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String STATUS = "status";

    public static final String INTER_CODE = "inter_code";

    public static final String CODE = "code";

    public static final String STORAGE_BOX_ID = "storage_box_id";

    public static final String IS_EMPTY = "is_empty";

    public static final String LOCATION_ID = "location_id";

    public static final String WORK_ORDER_NO = "work_order_no";

    public static final String PROCESS_CODE = "process_code";

    public static final String NEXT_PROCESS_CODE = "next_process_code";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
